package fr.cephb.socialsnp.core;

import java.io.Serializable;


import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import fr.cephb.util.XObject;


@Entity
@Table(name="dataset")

@NamedQuery(
	    name="datasetAll",
	    query="SELECT D FROM DataSet D ORDER BY D.id DESC"
	    )

public class DataSet
	extends XObject
	implements Serializable
	{
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private long id;
	@Column(nullable=false,name="name",unique=false,updatable=false)
	private String name;
	@Column(nullable=false,name="description",unique=false,updatable=true)
	@Basic(fetch=FetchType.LAZY)
	private String description;
	@Column(nullable=false,name="scope")
	@Enumerated(value=EnumType.STRING)
	private Scope scope;
	@Basic(fetch=FetchType.LAZY)
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable=false,name="creation")
	private java.util.Date creation;
	
	@Column(name="creator_id",updatable=true)
	@Basic(fetch=FetchType.LAZY)
	private long creatorId;
	
	public DataSet()
		{
		}
	
	@SuppressWarnings("unused")
	private void setId(long id) {
		this.id = id;
		}
	
	
	public long getId() {
		return id;
		}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Scope getScope() {
		return scope;
	}

	public void setScope(Scope scope) {
		this.scope = scope;
	}

	public java.util.Date getCreation() {
		return creation;
	}

	public void setCreation(java.util.Date creation) {
		this.creation = creation;
	}
	
	public void setCreatorId(long creatorId) {
		this.creatorId = creatorId;
		}
	
	public long getCreatorId() {
		return creatorId;
		}
	
	
	@Override
	public String toString() {
		return getName();
		}
	}


